<include file="Public/head"/>
<link type="text/css" rel="stylesheet" href="{:get_style_cdnurl()}paimai/yunying/plugin/select2/select2.css"/>
<script src="{:get_style_cdnurl()}paimai/yunying/plugin/select2/select2.js" type="text/javascript"></script>
<script src="http://img1.isou365.cn/paimai/yunying/js/city.js" type="text/javascript"></script>
<style type="text/css">
    .remarks {
        width: 100%;
        height: auto;
        margin-top: 20px;
    }

    .remarks span {
        display: block;
        width: 90px;
        float: left;
        line-height: 65px;
        font-size: 14px;
    }

    .remarks textarea {
        border: 1px solid #c8c8c8;
        float: left;
        height: 65px;
        padding: 5px;
        resize: none;
        width: 745px;
    }
</style>
<include file="Public/common_header"/>
<div class="mian">
    <include file="Public/sidebar" menu="clcwht.clzh"/>
    <div class="mianR">
        <h3 class="yonghu">处理详情</h3>
        <div class="chezhu-xinxi">
            <div class="xinxi-conter xinxi-conter1">
                <h4>原车信息</h4>
                <ul>
                    <li class="clearfix">
                        <em>原车品牌</em><em class="name-text1">{$detail.cur_car_series}</em>
                        <em>上牌时间</em><em class="name-text">{$detail.cur_reg_time}</em>
                    </li>
                    <li class="clearfix">
                        <em>原车所在地</em><em class="name-text1">{$detail.cur_loacation}</em>
                        <em>原车行驶历程</em><em class="name-text">{$detail.cur_mileage}</em>
                    </li>
                    <li class="clearfix">
                        <em>手机号</em><em class="name-text1">{$detail.mobile}</em>
                    </li>
                </ul>
            </div>
            <br/>

            <div class="xinxi-conter xinxi-conter1">
                <h4>置换信息</h4>
                <ul>
                    <li class="clearfix">
                        <em>置换新旧类型</em><em class="name-text1">{$detail.new_and_old_type}</em>
                        <em>置换车辆类型</em><em class="name-text">{$detail.chg_car_type}</em>
                    </li>
                    <li class="clearfix">
                        <em>置换品牌</em><em class="name-text1">{$detail.chg_car_brand}</em>
                        <em>置换预算</em><em class="name-text">{$detail.chg_budget}</em>
                    </li>
                    <li class="clearfix">
                        <em>置换年限</em><em class="name-text1">{$detail.chg_car_age}</em>
                    </li>
                </ul>
            </div>
        </div>
        <h3 class="yonghu">请选择置换结果</h3>
        <div class="yuyue">
            <ul>
                <li data-id="2" class="yuCurrent">置换成功</li>
                <li data-id="3">置换失败</li>
            </ul>
        </div>
        <div class="listBox">
            <div class="remarks clearfix">
                <span>*备注</span>
                <textarea name="chg_remark" id="chg_remark"></textarea>
            </div>
        </div>

        <div class="yongBtn">
            <input type="hidden" name="id" value="{$detail.chg_id}">
            <input type="hidden" name="chg_status" value="2">
            <input type="submit" value="确认" class="queding"/>
            <input class="quxiao" type="submit" value="返回" onclick="history.back();">
        </div>
    </div>
    <div class="clear"></div>
</div>
<script type="text/javascript">
    $(".yuyue ul li").click(function () {
        var chg_status = $(this).attr('data-id');
        $("input[name='chg_status']").val(chg_status);
        $("#chg_remark").val("");
    });

    $('.queding').on('click', function () {
        var chg_id = $("input[name='id']").val();
        var chg_status = $("input[name='chg_status']").val();
        var chg_remark = $.trim($("#chg_remark").val());
        if (chg_remark == '') {
            shibai_alert('备注不能为空');
        }
        var params = {
            'id': chg_id,
            'chg_status': chg_status,
            'chg_remark': chg_remark
        };
        $.post('/ChangeCar/doChangeCar', params, function (data) {
            if (data.code == '200') {
                btn_alert(data.msg, 2000, function () {
                    window.location.href = document.referrer;
                });
            } else {
                shibai_alert(data.msg);
                return false;
            }
        }, 'json');
    });
</script>
<include file="Public/foot"/>